<?php
class Func {
    static public function getCsv($filename, $delimiter=",", $enclosure="\"") {
        $handle = fopen($filename, "r");
        $data = array();
        $isFirstRow = true;
        while ($row = fgetcsv($handle, 0, $delimiter, $enclosure)) {
            if ($isFirstRow) {
                $isFirstRow = false;
                $firstRow = $row;
                continue;
            }
            $rowObj = new stdClass();
            foreach ($row as $key => $value) {
                $rowObj->{$firstRow[$key]} = $value;
            }
            $data[] = $rowObj;
        }
        fclose($handle);
        //var_dump($data);
        return $data;
    }
}